package com.sense.kukoo.biz_me.net

import com.sense.kukoo.common.repo.bean.*
import okhttp3.MultipartBody
import okhttp3.RequestBody
import retrofit2.http.*

interface MeHttpApi {

    /**首页配置查询 */
    @GET("/api/book/app-ui-conf/index")
    suspend fun index(): ResultBean<IndexBean>

    /**首页推荐栏数据查询 */
    @GET("/api/book/recommend")
    suspend fun recommend(): ResultBean<List<RecommendBean>>

    //首页配置navMenus中的code[编码] 等同于 firstTypeId[一级分类ID]
    /**导航栏页面数据查询*/
    @GET("/api/book/navigation/{firstTypeId}")
    suspend fun navigation(@Path("firstTypeId") firstTypeId: String): ResultBean<List<NavigationBean>>

    /**推荐频道: code 其它频道: 二级分类ID*/
    @GET("/api/book/more/{pageIndex}/{pageSize}/{code}")
    suspend fun more(
        @Path("pageIndex") firstTypeId: String,
        @Path("pageSize") pageSize: String,
        @Path("code") code: String
    ): ResultBean<QueryPageBean<BookBean>>

    /**登录*/
    @POST("/api/user/login")
    suspend fun login(@Body requestBody: RequestBody): ResultBean<LoginBean>

    /**第三方登录*/
    //source : 用户来源: 0. 内部; 1. facebook; 2. google; 3.apple; 4.twitter; 5. line;
    @POST("/api/user/third-login")
    suspend fun thirdLogin(@Body requestBody: RequestBody): ResultBean<LoginBean>

    /**发送验证码*/
    @POST("/api/user/send-verify-code")
    suspend fun sendVerifyCode(@Body requestBody: RequestBody): ResultBean<Boolean>

    /**反馈*/
    @POST("/api/user/feedback/save")
    suspend fun feedback(@Body requestBody: RequestBody): ResultBean<Boolean>


    /** 上传图片*/
    @Multipart
    @POST("/api/user/file/upload")
    suspend fun uploadPic( @PartMap params: Map<String, @JvmSuppressWildcards Any>, @Part file: MultipartBody.Part
    ): ResultBean<String>

    /**反馈*/
    @POST("/api/user/edit")
    suspend fun edit(@Body requestBody: RequestBody): ResultBean<Boolean>

    /**删除账号*/
    @POST("/api/user/remove")
    suspend fun remove(): ResultBean<Any>

}